The present invention relates generally to database management, and more particularly to the collection and analysis of database statistics.
For most database systems, the tasks of performance monitoring and tuning of the database requires the use of sophisticated tools to collect information and analyze the performance of the database system during the execution of a workload. Such methods can often be costly and inefficient to database users. Database performance is typically characterized by the cumulative amount of time users spend waiting for the database server to respond to their requests. System performance statistics are commonly needed for analysis when a problem has been reported to the administrator of the database system. For example, users may experience unsatisfactory response time while browsing web pages that require fetching data from the database. Each problem could have numerous potential causes, such as, for example, an undersized buffer cache, a badly written application or SQL, bad SQL plans due to stale optimizer statistics, etc.
Collecting performance-related data after the fact may sometimes produce fruitless results, as some problems are timing related. This is analogous to taking pictures of a crime scene to catch a criminal after the crime has been committed. Also, existing mechanisms to collect system data are generally difficult to develop and maintain as they involve data selection, storage, analysis, and the disposal of old data in order to free up space for future data collection. This usually incurs extra cost to database customers as they have to purchase sophisticated monitoring tools from third party vendors, as well as hire experienced database administrators to run these tools for monitoring and tuning purposes.
Collecting the right set of performance data is one key to identifying the most sever bottlenecks in the system. For example, under-collecting performance data may cause self-tuning advisors to provide the wrong recommendations or may result in undertaking incorrect remedies. Over-collecting performance data, on the other hand, may result in wasted system resources (e.g., storage space and processor usage) and in an unnecessarily large amount of analysis time.
Accordingly, it is desirable to provide systems and methods that track and store performance-related information in a database system. Such performance-related information should include the right amount and type of information and statistics useful for automatically tuning and analyzing database system performance in an efficient manner.